<?php $this->widget('application.extensions.grid.CGridView', array(
	'id'=>'category-grid',
	'dataProvider'=>$model->search(),
	//'filter'=>$model,
       'ajaxUrl'=>Yii::app()->createUrl("realEstate/admin"),
        //'showTableOnEmpty'=>FALSE,
'itemsCssClass' => 'table table-hover',
	'columns'=>array(
		//'id',
		'name',
		'description',
		array(
                'name' => 'activ',
                'type' => 'raw',
                'value' => '$data->activ=="1" ? CHtml::image("/images/accept.png",Yii::t("content","Ativo")):CHtml::image("/images/cancel.png",Yii::t("content","Desactivado"))',
            ),
		array(
                'class' => 'CButtonColumn',
                'template' => '{update}{delete}',
                'buttons' => array(
                    'delete' => array(
                        'url' => 'Yii::app()->createUrl("category/delete", array("id"=>$data->id))',
                        'imageUrl' => '/images/delete.png'
                    ),
                    'update' => array(
                        'url' => 'Yii::app()->createUrl("category/update", array("id"=>$data->id))',
                        'submit' => 'post',
                        'imageUrl' => '/images/page_white_edit.png',
                        //'options' => array('class'=>'updateFila')
                        ),
                ),
            ),
	),
)); ?>
<script>
    
        $('#category-grid').append('<br><a href="<?php echo Yii::app()->createUrl("category/create") ?>" class="btn btn-success"><?php echo Yii::t("content", 'Adicionar') ?></a>');
    

</script>